package com.yunju.xuexin.xuexincrawler.messagequene;

import io.zbus.mq.Message;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.io.IOException;

/**
 * Created by 刘治军 on 2017/10/24.
 */
@Component
public class XuexinProducer implements IProducer{

    @Autowired
    io.zbus.mq.Broker broker ;

    private io.zbus.mq.Producer producer;
    public XuexinProducer(){
        producer = new io.zbus.mq.Producer(broker);
    }


   @Override
   public Message publish(Message msg) throws IOException, InterruptedException {
       return producer.publish(msg);
   }



}
